<?php
use \Workerman\Autoloader;

require_once __DIR__ . '/../../../../../Workerman/Autoloader.php';
require_once __DIR__.'/../../../Config/Const.php';
Autoloader::setRootPath(__DIR__.'/../../..');

$page_groupId = GROUP_TREE_MNG;
$page_pageId = PAG_GG_ADD;

require "../framepages/moudle_base.php";

$mode = $_POST['mode'];
$result = 'normal';
if ($mode=='gg_dd') {
    $gg_name = $_POST['gg_name'];
    $gg_dw = $_POST['gg_dw'];

    $gg_record = new \Data\Tree_gg(array());
    $gg_record->setGG_NAME($gg_name);
    $gg_record->setGG_DW($gg_dw);

    \Data\Tree_gg_DAO::insert($gg_record);
    $result = "succ";
}
?>
<div class="main-content">
    <form action="" method="post">
        <input type="hidden" name="mode" id="mode" value='gg_dd'>
        <table>
            <tr>
                <td>规格名称:<td>
                <td><input type="text" id="gg_name" name="gg_name" ><td>
            </tr>

            <tr>
                <td>规格单位:<td>
                <td><input type="text" id="gg_dw" name="gg_dw" ><td>
            </tr>
        </table>
        <div class="btn-toolbar list-toolbar">
            <input type="submit" class="btn btn-danger" value="提交">
        </div>
    </form>

    <?php
    require "../framepages/footer.php";
    ?>
</div>
</div>
<script src="../lib/bootstrap/js/bootstrap.js"></script>
<script>
    function init() {
        var msg = '<?php echo $result ?>';
        if (msg == 'succ') {
            alert('添加成功');
        }
    }
</script>
</body>
</html>
